Syntax to assign attribute value directory from another object?

Using an integer attribute "myAttr" as an example, is there a syntax that will let me avoid using an intermediate variable,

so that I can assign one object's attribute value directly to the same attribute in another object?

Here is what I am doing now:

Object o1=current
Object o2=next(o1)
int i=o1."myAttr"
o2."myAttr"=i
//note: o2."myAttr"=o1."myAttr" (and variants trying to cast to int) do not work

 


strathglass - Tue Aug 15 16:07:46 EDT 2017

Re: Syntax to assign attribute value directory from another object?
Mathias Mamsch - Wed Aug 16 03:24:15 EDT 2017

I think you can use

set(o2."myAttr", o1."myAttr")

Regards, Mathias

Re: Syntax to assign attribute value directory from another object?
strathglass - Wed Aug 16 07:50:01 EDT 2017

Forgot about the undocumented set() function, I have in fact used that one before!

Was hoping the language had a defined syntax that made this simple, but set() will do!

Thanks Mathias!